﻿using System.Drawing;
using IntelligentGateway.Data;
using IntelligentGateway.Model;
using IntelligentGateway.Services;
using IntelligentGateway.SmartCommunity.DevicePlatform;
using IntelligentGateway.SmartCommunity.Model;
using IntelligentGateway.Tools;
using Microsoft.AspNetCore.Mvc;
using ResponseMessage = IntelligentGateway.SmartCommunity.Model.ResponseMessage;

namespace IntelligentGateway.Controllers.api
{
    [Route("api/[controller]")]
    [ApiController]
    public class SmartController : ControllerBase
    {

        [HttpPost]
        [Route("DisableLiftControl")]
        public bool DisableLiftControl(int deviceid)
        {
            bool result = IGTCPServerMessageProcess.SmartDisableLiftControl(deviceid);
            return result;
        }

        [HttpPost]
        [Route("EnableLiftControl")]
        public bool EnableLiftControl(int deviceid)
        {
            bool result = IGTCPServerMessageProcess.SmartEnableLiftControl(deviceid);
            return result;
        }

        [HttpPost]
        [Route("QueryDevice")]
        public ResponseMessage QueryDevice()
        {
            ResponseMessage message = new ResponseMessage();
            message.data = GlobalVariables.DeviceList;
            return message;
        }

        [HttpPost]
        [Route("QueryState")]
        public ResponseMessage QueryState()
        {
            ResponseMessage message = new ResponseMessage();
            message.data = CEMSDeviceSerialData.elevators_state;
            return message;
        }
    }
}
